package com.dao;

import com.entity.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface UserDao {
    @Select("select * from USER ;")
    List<User> findAll();
    @Select("select * from USER where id = #{id} ;")
    User findById(int id);
    @Insert("insert into USER values (#{username},#{password}),#{status};")
    int addOne(User user);
    @Delete("delete from USER where id = #{id};")
    int deleteOne(int id);
    @Update("update USER set username = #{username},password=#{password} where id=#{id};")
    int updateOne(User user);
}
